<?php

session_start();

// this sets variables in the session 

include_once('connection.php');
//include '../js/products.js';
$productID = $_POST['id'];
//echo $productID;

$sql="UPDATE `products` SET visit_num = visit_num+1 WHERE id=".$productID;
mysql_query($sql);

$sql = "SELECT * FROM `products` WHERE id = " . $productID . "";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
    echo '<div id="infoDivProduct">
                <a href="javascript:void(0);" title="close" class="infoDivButtons"><img class="infoDivButtons" src="images/close.png" width="30px"/></a>
                <div id="infoDivPic">
                    <img src="../photos/thumb/'.$row['img'].'" width="100%" />
                </div>
                <div id="infoDivDetails">
                    <table>
                        <tr>
                            <td width="100px;">Product Title</td>
                            <td width="300px;">'.$row['name_en'].'</td>
                        </tr>
                        <tr>
                            <td>Description</td>
                            <td>'.$row['desc_en'].'</td>
                        </tr>
                        <tr>
                            <td>Price</td>
                            <td>'.$row['price'].'</td>
                        </tr>
                        <tr>
                            <td>Visits</td>
                            <td>'.$row['visit_num'].'</td>
                        </tr>
                        
                    </table>
                    
                </div>
            </div>
            ';
}
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
?>
